home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / humannat.bst (.txt) < prev    next >
LaTeX Document  |  1992-07-19  |  25KB  |  969 lines

  1. %%% ====================================================================
  2. %%%  @BibTeX-style-file{
  3. %%%     author          = "Alan Rogers",
  4. %%%     version         = "1.03",
  5. %%%     date            = "29 June 1992",
  6. %%%     time            = "09:34:02 MDT",
  7. %%%     filename        = "humanbio.bst",
  8. %%%     address         = "Dept of Anthropology, University of Utah,
  9. %%%                        Salt Lake City, UT 84112",
  10. %%%     checksum        = "39728 1205 3408 25147",
  11. %%%     email           = "rogers@anthro.utah.edu",
  12. %%%     supported       = "no",
  13. %%%     docstring       = "The file produces bibliographies more or
  14. %%%                        less in the format of the journals Human
  15. %%%                        Nature and American Anthropologist.  It was
  16. %%%                        adapted from apalike.bst, incorporating
  17. %%%                        features of Sake J.  Hogeveen's
  18. %%%                        `astron.bst'.
  19. %%%                        Usage: \documentstyle[astron]{...}
  20. %%%                        ...
  21. %%%                        \bibliographystyle{humannat}
  22. %%%                        ...
  23. %%%                        The \documentstyle command above invokes
  24. %%%                        Hogeveen's `astron.sty', which must be in
  25. %%%                        TeX's search path.
  26. %%%                        The modifications implement `\cite*{}',
  27. %%%                        which generates references in short form.
  28. %%%                        For example, `Rogers \cite*{...}' would
  29. %%%                        produce `Rogers (1992)'."
  30. %%%  }
  31. %%% ====================================================================
  32. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  33. % BibTeX `apalike' bibliography style (24-Jan-88 version)
  34. % Adapted from the `alpha' style, version 0.99a; for BibTeX version 0.99a.
  35. % Copyright (C) 1988, all rights reserved.
  36. % Copying of this file is allowed, provided that if you make any changes at all
  37. % you name it something other than `apalike.bst'.
  38. % This restriction helps ensure that all copies are identical.
  39. % Differences between this style and `alpha' are generally heralded by a `%'.
  40. % The file btxbst.doc has the documentation for alpha.bst.
  41. % This style should be used with the `apalike' LaTeX style (apalike.sty).
  42. % \cite's come out like "(Jones, 1986)" in the text but there are no labels
  43. % in the bibliography, and something like "(1986)" comes out immediately
  44. % after the author.  Author (and editor) names appear as last name, comma,
  45. % initials.  A `year' field is required for every entry, and so is either
  46. % an author (or in some cases, an editor) field or a key field.
  47. % Editorial note:
  48. % Many journals require a style like `apalike', but I strongly, strongly,
  49. % strongly recommend that you not use it if you have a choice---use something
  50. % like `plain' instead.  Mary-Claire van Leunen (A Handbook for Scholars,
  51. % Knopf, 1979) argues convincingly that a style like `plain' encourages better
  52. % writing than one like `apalike'.  Furthermore the strongest arguments for
  53. % using an author-date style like `apalike'---that it's "the most practical"
  54. % (The Chicago Manual of Style, University of Chicago Press, thirteenth
  55. % edition, 1982, pages 400--401)---fall flat on their face with the new
  56. % computer-typesetting technology.  For instance page 401 anachronistically
  57. % states "The chief disadvantage of [a style like `plain'] is that additions
  58. % or deletions cannot be made after the manuscript is typed without changing
  59. % numbers in both text references and list."  LaTeX sidesteps the disadvantage.
  60. % History:
  61. %   15-sep-86    (SK,OP)    Original version, by Susan King and Oren Patashnik.
  62. %   10-nov-86    (OP)    Truncated the sort.key$ string to the correct length
  63. %            in bib.sort.order to eliminate error message.
  64. %   24-jan-88    (OP)    Updated for BibTeX version 0.99a, from alpha.bst 0.99a;
  65. %            apalike now sorts by author, then year, then title;
  66. %            THIS `apalike' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
  67. ENTRY
  68.   { address
  69.     author
  70.     booktitle
  71.     chapter
  72.     edition
  73.     editor
  74.     howpublished
  75.     institution
  76.     journal
  77.     key
  78. %    month        not used in apalike
  79.     note
  80.     number
  81.     organization
  82.     pages
  83.     publisher
  84.     school
  85.     series
  86.     title
  87.     type
  88.     volume
  89.     year
  90.   { label extra.label sort.label }
  91. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  92. FUNCTION {init.state.consts}
  93. { #0 'before.all :=
  94.   #1 'mid.sentence :=
  95.   #2 'after.sentence :=
  96.   #3 'after.block :=
  97. STRINGS { s t }
  98. FUNCTION {output.nonnull}
  99. { 's :=
  100.   output.state mid.sentence =
  101.     { ", " * write$ }
  102.     { output.state after.block =
  103.     { add.period$ write$
  104.       newline$
  105.       "\newblock " write$
  106.     { output.state before.all =
  107.         'write$
  108.         { add.period$ " " * write$ }
  109.       if$
  110.       if$
  111.       mid.sentence 'output.state :=
  112.     }
  113.   if$
  114. FUNCTION {output}
  115. { duplicate$ empty$
  116.     'pop$
  117.     'output.nonnull
  118.   if$
  119. FUNCTION {output.check}
  120. { 't :=
  121.   duplicate$ empty$
  122.     { pop$ "empty " t * " in " * cite$ * warning$ }
  123.     'output.nonnull
  124.   if$
  125. %                    apalike needs this function because
  126. %                    the year has special punctuation;
  127. %                    apalike ignores the month
  128. FUNCTION {output.year.check}
  129. { year empty$
  130.     { "empty year in " cite$ * warning$ }
  131.     { write$
  132. %      " (" year * extra.label * ")" *
  133.       " " year * extra.label *           % for humannature
  134.       mid.sentence 'output.state :=
  135.     }
  136.   if$
  137. FUNCTION {output.bibitem}
  138. { newline$
  139.   "\bibitem[" write$
  140.   label write$
  141.   "]{" write$
  142.   cite$ write$
  143.   "}" write$
  144.   newline$
  145.   before.all 'output.state :=
  146. FUNCTION {fin.entry}
  147. { add.period$
  148.   write$
  149.   newline$
  150. FUNCTION {new.block}
  151. { output.state before.all =
  152.     'skip$
  153.     { after.block 'output.state := }
  154.   if$
  155. FUNCTION {new.sentence}
  156. { output.state after.block =
  157.     'skip$
  158.     { output.state before.all =
  159.     'skip$
  160.     { after.sentence 'output.state := }
  161.       if$
  162.     }
  163.   if$
  164. FUNCTION {not}
  165. {   { #0 }
  166.     { #1 }
  167.   if$
  168. FUNCTION {and}
  169. {   'skip$
  170.     { pop$ #0 }
  171.   if$
  172. FUNCTION {or}
  173. {   { pop$ #1 }
  174.     'skip$
  175.   if$
  176. FUNCTION {new.block.checkb}
  177. { empty$
  178.   swap$ empty$
  179.   and
  180.     'skip$
  181.     'new.block
  182.   if$
  183. FUNCTION {field.or.null}
  184. { duplicate$ empty$
  185.     { pop$ "" }
  186.     'skip$
  187.   if$
  188. FUNCTION {emphasize}
  189. { duplicate$ empty$
  190.     { pop$ "" }
  191.     { "{\em " swap$ * "}" * }
  192.   if$
  193. INTEGERS { nameptr namesleft numnames }
  194. FUNCTION {format.names}
  195. { 's :=
  196.   #1 'nameptr :=
  197.   s num.names$ 'numnames :=
  198.   numnames 'namesleft :=
  199.   s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=   % last name first
  200.       nameptr #1 >
  201.     { namesleft #1 >
  202.         { ", " * t * }
  203.         { numnames #2 >
  204.         { "," * }
  205.         'skip$
  206.           if$
  207.           t "others" =
  208.         { " et~al." * }
  209.         { " and " * t * }
  210.           if$
  211.         }
  212.       if$
  213.       if$
  214.   nameptr #1 + 'nameptr :=
  215.   namesleft #1 - 'namesleft :=
  216.     { namesleft #0 > }
  217.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=   % last name last
  218.       nameptr #1 >
  219.     { namesleft #1 >
  220.         { ", " * t * }
  221.         { numnames #2 >
  222.         { "," * }
  223.         'skip$
  224.           if$
  225.           t "others" =
  226.         { " et~al." * }
  227.         { " and " * t * }
  228.           if$
  229.         }
  230.       if$
  231.       if$
  232.       nameptr #1 + 'nameptr :=
  233.       namesleft #1 - 'namesleft :=
  234.     }
  235.   while$
  236. FUNCTION {format.editor.names}
  237. { 's :=
  238.   #1 'nameptr :=
  239.   s num.names$ 'numnames :=
  240.   numnames 'namesleft :=
  241.     { namesleft #0 > }
  242.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=   % last name first
  243.       nameptr #1 >
  244.     { namesleft #1 >
  245.         { ", " * t * }
  246.         { numnames #2 >
  247.         { "," * }
  248.         'skip$
  249.           if$
  250.           t "others" =
  251.         { " et~al." * }
  252.         { " and " * t * }
  253.           if$
  254.         }
  255.       if$
  256.       if$
  257.       nameptr #1 + 'nameptr :=
  258.       namesleft #1 - 'namesleft :=
  259.     }
  260.   while$
  261. FUNCTION {format.authors}
  262. { author empty$
  263.     { "" }
  264.     { author format.names }
  265.   if$
  266.   "\leavevmode\nopagebreak\newline" *   % for humannature
  267. FUNCTION {format.key}            % this function is just for apalike
  268. { empty$
  269.     { key field.or.null }
  270.     { "" }
  271.   if$
  272. FUNCTION {format.editors}
  273. { editor empty$
  274.     { "" }
  275.     { author empty$
  276.         { editor format.names }
  277.         { editor format.editor.names }
  278.       if$
  279.       editor num.names$ #1 >
  280.     { ", eds." * }         % for humannature
  281.     { ", ed." * }          % for humannature
  282.       if$
  283.     }
  284.   if$
  285.   author empty$
  286.     { "\leavevmode\nopagebreak\newline" * }
  287.     { "" * }
  288.   if$
  289. FUNCTION {format.title}
  290. { title empty$
  291.     { "" }
  292.     { title "t" change.case$ }
  293.   if$
  294. FUNCTION {n.dashify}
  295. { 't :=
  296.     { t empty$ not }
  297.     { t #1 #1 substring$ "-" =
  298.     { t #1 #2 substring$ "--" = not
  299.         { "--" *
  300.           t #2 global.max$ substring$ 't :=
  301.         }
  302.         {   { t #1 #1 substring$ "-" = }
  303.         { "-" *
  304.           t #2 global.max$ substring$ 't :=
  305.           while$
  306.         }
  307.       if$
  308.     { t #1 #1 substring$ *
  309.       t #2 global.max$ substring$ 't :=
  310.       if$
  311.     }
  312.   while$
  313. FUNCTION {format.btitle}
  314. { title emphasize
  315. FUNCTION {tie.or.space.connect}
  316. { duplicate$ text.length$ #3 <
  317.     { "~" }
  318.     { " " }
  319.   if$
  320.   swap$ * *
  321. FUNCTION {either.or.check}
  322. { empty$
  323.     'pop$
  324.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  325.   if$
  326. FUNCTION {format.bvolume}
  327. { volume empty$
  328.     { "" }
  329.     { "volume" volume tie.or.space.connect
  330.       series empty$
  331.     'skip$
  332.     { " of " * series emphasize * }
  333.       if$
  334.       "volume and number" number either.or.check
  335.     }
  336.   if$
  337. FUNCTION {format.number.series}
  338. { volume empty$
  339.     { number empty$
  340.     { series field.or.null }
  341.     { output.state mid.sentence =
  342.         { "number" }
  343.         { "Number" }
  344.       if$
  345.       number tie.or.space.connect
  346.       series empty$
  347.         { "there's a number but no series in " cite$ * warning$ }
  348.         { " in " * series * }
  349.       if$
  350.       if$
  351.     }
  352.     { "" }
  353.   if$
  354. FUNCTION {format.address.publisher}
  355. { address empty$
  356.     {
  357.       publisher empty$
  358.         { "" }
  359.         { publisher }
  360.       if$
  361.     }
  362.     {
  363.       publisher empty$
  364.         { address ": [publisher unknown]" * }
  365.         { address ": " * publisher * }
  366.       if$
  367.     }
  368.   if$
  369. FUNCTION {format.edition}
  370. { edition empty$
  371.     { "" }
  372.     { output.state mid.sentence =
  373.     { edition "l" change.case$ " edition" * }
  374.     { edition "t" change.case$ " edition" * }
  375.       if$
  376.     }
  377.   if$
  378. INTEGERS { multiresult }
  379. FUNCTION {multi.page.check}
  380. { 't :=
  381.   #0 'multiresult :=
  382.     { multiresult not
  383.       t empty$ not
  384.       and
  385.     }
  386.     { t #1 #1 substring$
  387.       duplicate$ "-" =
  388.       swap$ duplicate$ "," =
  389.       swap$ "+" =
  390.       or or
  391.     { #1 'multiresult := }
  392.     { t #2 global.max$ substring$ 't := }
  393.       if$
  394.     }
  395.   while$
  396.   multiresult
  397. FUNCTION {format.pages}
  398. { pages empty$
  399.     { "" }
  400.     { pages multi.page.check
  401.     { "Pp.~" pages n.dashify tie.or.space.connect }
  402.     { "P.~" pages tie.or.space.connect }
  403.       if$
  404.     }
  405.   if$
  406. FUNCTION {format.vol.num.pages}
  407. { volume field.or.null
  408.   number empty$
  409.     'skip$
  410.     { "(" number * ")" * *
  411.       volume empty$
  412.     { "there's a number but no volume in " cite$ * warning$ }
  413.     'skip$
  414.       if$
  415.     }
  416.   if$
  417.   pages empty$
  418.     'skip$
  419.     { duplicate$ empty$
  420.     { pop$ format.pages }
  421.     { ":" * pages n.dashify * }
  422.       if$
  423.     }
  424.   if$
  425. FUNCTION {format.chapter.pages}
  426. { chapter empty$
  427.     'format.pages
  428.     { type empty$
  429.     { "chapter" }
  430.     { type "l" change.case$ }
  431.       if$
  432.       chapter tie.or.space.connect
  433.       pages empty$
  434.     'skip$
  435.     { ", " * format.pages * }
  436.       if$
  437.     }
  438.   if$
  439. FUNCTION {format.in.ed.booktitle}
  440. { booktitle empty$
  441.     { "" }
  442.     { editor empty$
  443.     { "In " booktitle emphasize * }
  444.     { "In " booktitle emphasize * ", " * format.editors * }
  445.       if$
  446.     }
  447.   if$
  448. FUNCTION {format.thesis.type}
  449. { type empty$
  450.     'skip$
  451.     { pop$
  452.       type "t" change.case$
  453.     }
  454.   if$
  455. FUNCTION {format.tr.number}
  456. { type empty$
  457.     { "Technical Report" }
  458.     'type
  459.   if$
  460.   number empty$
  461.     { "t" change.case$ }
  462.     { number tie.or.space.connect }
  463.   if$
  464. FUNCTION {format.article.crossref}
  465. { "In"                            % this is for apalike
  466.   " \cite{" * crossref * "}" *
  467. FUNCTION {format.book.crossref}
  468. { volume empty$
  469.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  470.       "In "
  471.     }
  472.     { "Volume" volume tie.or.space.connect
  473.       " of " *
  474.     }
  475.   if$
  476.   "\cite{" * crossref * "}" *                % this is for apalike
  477. FUNCTION {format.incoll.inproc.crossref}
  478. { "In"                            % this is for apalike
  479.   " \cite{" * crossref * "}" *
  480. FUNCTION {article}
  481. { output.bibitem
  482.   format.authors "author" output.check
  483.   author format.key output                % special for
  484.   output.year.check                    % apalike
  485.   new.block
  486.   format.title "title" output.check
  487.   new.block
  488.   crossref missing$
  489.     { journal emphasize "journal" output.check
  490.       format.vol.num.pages output
  491.     }
  492.     { format.article.crossref output.nonnull
  493.       format.pages output
  494.     }
  495.   if$
  496.   new.block
  497.   note output
  498.   fin.entry
  499. FUNCTION {book}
  500. { output.bibitem
  501.   author empty$
  502.     { format.editors "author and editor" output.check
  503.       editor format.key output
  504.     }
  505.     { format.authors output.nonnull
  506.       crossref missing$
  507.     { "author and editor" editor either.or.check }
  508.     'skip$
  509.       if$
  510.     }
  511.   if$
  512.   output.year.check                % special for apalike
  513.   new.block
  514.   format.btitle "title" output.check
  515.   crossref missing$
  516.     { format.bvolume output
  517.       format.number.series output
  518.       format.edition output
  519.       new.block
  520.       format.address.publisher output
  521.     }
  522.     { new.block
  523.       format.book.crossref output.nonnull
  524.     }
  525.   if$
  526.   new.block
  527.   note output
  528.   fin.entry
  529. FUNCTION {booklet}
  530. { output.bibitem
  531.   format.authors output
  532.   author format.key output                % special for
  533.   output.year.check                    % apalike
  534.   new.block
  535.   format.title "title" output.check
  536.   new.block
  537.   howpublished output
  538.   address output
  539.   new.block
  540.   note output
  541.   fin.entry
  542. FUNCTION {inbook}
  543. { output.bibitem
  544.   author empty$
  545.     { format.editors "author and editor" output.check
  546.       editor format.key output
  547.     }
  548.     { format.authors output.nonnull
  549.       crossref missing$
  550.     { "author and editor" editor either.or.check }
  551.     'skip$
  552.       if$
  553.     }
  554.   if$
  555.   output.year.check                % special for apalike
  556.   new.block
  557.   format.btitle "title" output.check
  558.   crossref missing$
  559.     { format.bvolume output
  560.       format.chapter.pages "chapter and pages" output.check
  561.       new.block
  562.       format.number.series output
  563.       new.block
  564.       format.address.publisher output
  565.     }
  566.     { format.chapter.pages "chapter and pages" output.check
  567.       new.block
  568.       format.book.crossref output.nonnull
  569.     }
  570.   if$
  571.   format.edition output
  572.   new.block
  573.   note output
  574.   fin.entry
  575. FUNCTION {incollection}
  576. { output.bibitem
  577.   format.authors "author" output.check
  578.   author format.key output                % special for
  579.   output.year.check                    % apalike
  580.   new.block
  581.   format.title "title" output.check
  582.   new.block
  583.   crossref missing$
  584.     { format.in.ed.booktitle "booktitle" output.check
  585.       format.bvolume output
  586.       format.number.series output
  587.       format.chapter.pages output
  588.       new.block
  589.       format.address.publisher output
  590.     }
  591.     { format.incoll.inproc.crossref output.nonnull
  592.       format.chapter.pages output
  593.     }
  594.   if$
  595.   new.block
  596.   note output
  597.   fin.entry
  598. FUNCTION {inproceedings}
  599. { output.bibitem
  600.   format.authors "author" output.check
  601.   author format.key output                % special for
  602.   output.year.check                    % apalike
  603.   new.block
  604.   format.title "title" output.check
  605.   new.block
  606.   crossref missing$
  607.     { format.in.ed.booktitle "booktitle" output.check
  608.       format.bvolume output
  609.       format.number.series output
  610.       format.pages output
  611.       address output                    % for apalike
  612.       new.sentence                    % there's no year
  613.       organization output                % here so things
  614.       publisher output                    % are simpler
  615.     }
  616.     { format.incoll.inproc.crossref output.nonnull
  617.       format.pages output
  618.     }
  619.   if$
  620.   new.block
  621.   note output
  622.   fin.entry
  623. FUNCTION {conference} { inproceedings }
  624. FUNCTION {manual}
  625. { output.bibitem
  626.   format.authors output
  627.   author format.key output                % special for
  628.   output.year.check                    % apalike
  629.   new.block
  630.   format.btitle "title" output.check
  631.   organization address new.block.checkb
  632.   organization output
  633.   address output
  634.   format.edition output
  635.   new.block
  636.   note output
  637.   fin.entry
  638. FUNCTION {mastersthesis}
  639. { output.bibitem
  640.   format.authors "author" output.check
  641.   author format.key output                % special for
  642.   output.year.check                    % apalike
  643.   new.block
  644.   format.title "title" output.check
  645.   new.block
  646.   "Master's thesis" format.thesis.type output.nonnull
  647.   school "school" output.check
  648.   address output
  649.   new.block
  650.   note output
  651.   fin.entry
  652. FUNCTION {misc}
  653. { output.bibitem
  654.   format.authors output
  655.   author format.key output                % special for
  656.   output.year.check                    % apalike
  657.   new.block
  658.   format.title output
  659.   new.block
  660.   howpublished output
  661.   new.block
  662.   note output
  663.   fin.entry
  664. FUNCTION {phdthesis}
  665. { output.bibitem
  666.   format.authors "author" output.check
  667.   author format.key output                % special for
  668.   output.year.check                    % apalike
  669.   new.block
  670.   format.btitle "title" output.check
  671.   new.block
  672.   "PhD thesis" format.thesis.type output.nonnull
  673.   school "school" output.check
  674.   address output
  675.   new.block
  676.   note output
  677.   fin.entry
  678. FUNCTION {proceedings}
  679. { output.bibitem
  680.   format.editors output
  681.   editor format.key output                % special for
  682.   output.year.check                    % apalike
  683.   new.block
  684.   format.btitle "title" output.check
  685.   format.bvolume output
  686.   format.number.series output
  687.   address output                % for apalike
  688.   new.sentence                    % we always output
  689.   organization output                % a nonempty organization
  690.   publisher output                % here
  691.   new.block
  692.   note output
  693.   fin.entry
  694. FUNCTION {techreport}
  695. { output.bibitem
  696.   format.authors "author" output.check
  697.   author format.key output                % special for
  698.   output.year.check                    % apalike
  699.   new.block
  700.   format.title "title" output.check
  701.   new.block
  702.   format.tr.number output.nonnull
  703.   institution "institution" output.check
  704.   address output
  705.   new.block
  706.   note output
  707.   fin.entry
  708. FUNCTION {unpublished}
  709. { output.bibitem
  710.   format.authors "author" output.check
  711.   author format.key output                % special for
  712.   output.year.check                    % apalike
  713.   new.block
  714.   format.title "title" output.check
  715.   new.block
  716.   note "note" output.check
  717.   fin.entry
  718. FUNCTION {default.type} { misc }
  719. MACRO {jan} {"January"}
  720. MACRO {feb} {"February"}
  721. MACRO {mar} {"March"}
  722. MACRO {apr} {"April"}
  723. MACRO {may} {"May"}
  724. MACRO {jun} {"June"}
  725. MACRO {jul} {"July"}
  726. MACRO {aug} {"August"}
  727. MACRO {sep} {"September"}
  728. MACRO {oct} {"October"}
  729. MACRO {nov} {"November"}
  730. MACRO {dec} {"December"}
  731. MACRO {acmcs} {"ACM Computing Surveys"}
  732. MACRO {acta} {"Acta Informatica"}
  733. MACRO {cacm} {"Communications of the ACM"}
  734. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  735. MACRO {ibmsj} {"IBM Systems Journal"}
  736. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  737. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  738. MACRO {ieeetcad}
  739.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  740. MACRO {ipl} {"Information Processing Letters"}
  741. MACRO {jacm} {"Journal of the ACM"}
  742. MACRO {jcss} {"Journal of Computer and System Sciences"}
  743. MACRO {scp} {"Science of Computer Programming"}
  744. MACRO {sicomp} {"SIAM Journal on Computing"}
  745. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  746. MACRO {tods} {"ACM Transactions on Database Systems"}
  747. MACRO {tog} {"ACM Transactions on Graphics"}
  748. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  749. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  750. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  751. MACRO {tcs} {"Theoretical Computer Science"}
  752. FUNCTION {sortify}
  753. { purify$
  754.   "l" change.case$
  755. INTEGERS { len }
  756. FUNCTION {chop.word}
  757. { 's :=
  758.   'len :=
  759.   s #1 len substring$ =
  760.     { s len #1 + global.max$ substring$ }
  761.     's
  762.   if$
  763. %            There are three apalike cases: one person (Jones),
  764. %            two (Jones and de~Bruijn), and more (Jones et~al.).
  765. %            This function is much like format.crossref.editors.
  766. FUNCTION {format.lab.names}
  767. { 's :=
  768.   s #1 "{vv~}{ll}" format.name$
  769.   s num.names$ duplicate$
  770.   #2 >
  771.     { pop$ " et~al." * }
  772.     { #2 <
  773.     'skip$
  774.     { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  775.         { " et~al." * }
  776.         { " and " * s #2 "{vv~}{ll}" format.name$ * }
  777.       if$
  778.       if$
  779.     }
  780.   if$
  781. FUNCTION {author.key.label}
  782. { author empty$
  783.     { key empty$
  784.     { cite$ #1 #3 substring$ }
  785.     'key                    % apalike uses the whole key
  786.       if$
  787.     }
  788.     { author format.lab.names }
  789.   if$
  790. FUNCTION {author.editor.key.label}
  791. { author empty$
  792.     { editor empty$
  793.     { key empty$
  794.         { cite$ #1 #3 substring$ }
  795.         'key                % apalike uses the whole key
  796.       if$
  797.     { editor format.lab.names }
  798.       if$
  799.     }
  800.     { author format.lab.names }
  801.   if$
  802. FUNCTION {editor.key.label}
  803. { editor empty$
  804.     { key empty$
  805.     { cite$ #1 #3 substring$ }
  806.     'key            % apalike uses the whole key, no organization
  807.       if$
  808.     }
  809.     { editor format.lab.names }
  810.   if$
  811. FUNCTION {calc.label}      % this function came from ASTRON.BST (ARR)
  812. { type$ "book" =
  813.   type$ "inbook" =
  814.     'author.editor.key.label
  815.     { type$ "proceedings" =
  816.         'editor.key.label                       % apalike ignores organization
  817.         'author.key.label                       % for labeling and sorting
  818.       if$
  819.     }
  820.   if$
  821.   "\protect\astroncite{" swap$ * "}{"                   % these three lines are
  822.   *                                                     % for apalike, which
  823.   year field.or.null purify$ #-1 #4 substring$          % uses all four digits
  824.   *                       % the mathing closing "}" comes in at the reverse.pass
  825.   'label :=
  826. FUNCTION {sort.format.names}
  827. { 's :=
  828.   #1 'nameptr :=
  829.   s num.names$ 'numnames :=
  830.   numnames 'namesleft :=
  831.     { namesleft #0 > }
  832.     { nameptr #1 >
  833.     { "   " * }
  834.     'skip$
  835.       if$                        % apalike uses initials
  836.       s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't := % <= here
  837.       nameptr numnames = t "others" = and
  838.     { "et al" * }
  839.     { t sortify * }
  840.       if$
  841.       nameptr #1 + 'nameptr :=
  842.       namesleft #1 - 'namesleft :=
  843.     }
  844.   while$
  845. FUNCTION {sort.format.title}
  846. { 't :=
  847.   "A " #2
  848.     "An " #3
  849.       "The " #4 t chop.word
  850.     chop.word
  851.   chop.word
  852.   sortify
  853.   #1 global.max$ substring$
  854. FUNCTION {author.sort}
  855. { author empty$
  856.     { key empty$
  857.     { "to sort, need author or key in " cite$ * warning$
  858.       ""
  859.     { key sortify }
  860.       if$
  861.     }
  862.     { author sort.format.names }
  863.   if$
  864. FUNCTION {author.editor.sort}
  865. { author empty$
  866.     { editor empty$
  867.     { key empty$
  868.         { "to sort, need author, editor, or key in " cite$ * warning$
  869.           ""
  870.         }
  871.         { key sortify }
  872.       if$
  873.     { editor sort.format.names }
  874.       if$
  875.     }
  876.     { author sort.format.names }
  877.   if$
  878. FUNCTION {editor.sort}
  879. { editor empty$
  880.     { key empty$
  881.     { "to sort, need editor or key in " cite$ * warning$
  882.       ""
  883.     { key sortify }
  884.       if$
  885.     }
  886.     { editor sort.format.names }
  887.   if$
  888. %            apalike uses two sorting passes; the first one sets the
  889. %            labels so that the `a's, `b's, etc. can be computed;
  890. %            the second pass puts the references in "correct" order.
  891. %            The presort function is for the first pass. It computes
  892. %            label, sort.label, and title, and then concatenates.
  893. FUNCTION {presort}
  894. { calc.label
  895.   label sortify
  896.   "    "
  897.   type$ "book" =
  898.   type$ "inbook" =
  899.     'author.editor.sort
  900.     { type$ "proceedings" =
  901.     'editor.sort
  902.     'author.sort
  903.       if$
  904.     }
  905.   if$
  906.   #1 entry.max$ substring$    % for
  907.   'sort.label :=        % apalike
  908.   sort.label            % style
  909.   "    "
  910.   title field.or.null
  911.   sort.format.title
  912.   #1 entry.max$ substring$
  913.   'sort.key$ :=
  914. ITERATE {presort}
  915. SORT        % by label, sort.label, title---for final label calculation
  916. STRINGS { last.label next.extra }    % apalike labels are only for the text;
  917. INTEGERS { last.extra.num }        % there are none in the bibliography
  918. FUNCTION {initialize.extra.label.stuff}    % and hence there is no `longest.label'
  919. { #0 int.to.chr$ 'last.label :=
  920.   "" 'next.extra :=
  921.   #0 'last.extra.num :=
  922. FUNCTION {forward.pass}
  923. { last.label label =
  924.     { last.extra.num #1 + 'last.extra.num :=
  925.       last.extra.num int.to.chr$ 'extra.label :=
  926.     }
  927.     { "a" chr.to.int$ 'last.extra.num :=
  928.       "" 'extra.label :=
  929.       label 'last.label :=
  930.     }
  931.   if$
  932. FUNCTION {reverse.pass}       % this function came from ASTRON.BST (ARR)
  933. { next.extra "b" =
  934.     { "a" 'extra.label := }
  935.     'skip$
  936.   if$
  937.   label extra.label * "}" * 'label :=
  938.   extra.label 'next.extra :=
  939. EXECUTE {initialize.extra.label.stuff}
  940. ITERATE {forward.pass}
  941. REVERSE {reverse.pass}
  942. %                Now that the label is right we sort for real,
  943. %                on sort.label then year then title.  This is
  944. %                for the second sorting pass.
  945. FUNCTION {bib.sort.order}
  946. { sort.label
  947.   "    "
  948.   year field.or.null sortify
  949.   "    "
  950.   title field.or.null
  951.   sort.format.title
  952.   #1 entry.max$ substring$
  953.   'sort.key$ :=
  954. ITERATE {bib.sort.order}
  955. SORT        % by sort.label, year, title---giving final bibliography order
  956. FUNCTION {begin.bib}
  957. { preamble$ empty$                % no \etalchar in apalike
  958.     'skip$
  959.     { preamble$ write$ newline$ }
  960.   if$
  961.   "\begin{thebibliography}{}" write$ newline$        % no labels in apalike
  962. EXECUTE {begin.bib}
  963. EXECUTE {init.state.consts}
  964. ITERATE {call.type$}
  965. FUNCTION {end.bib}
  966. { newline$
  967.   "\end{thebibliography}" write$ newline$
  968. EXECUTE {end.bib}
  969.